package Get4;

use Moose;
use HTML::TreeBuilder;

sub lookdown {
    my ( $name, %params ) = @_;
    my $seeks = delete $params{seeks};
    has $name => (
		  is => 'ro',
		  lazy    => 1,
		  default => sub { $_[0]->tree->look_down(@$seeks) }
		 );
}

has file => (
    is      => 'rw',
    default => 'file.html'
);

has tree => (
    is         => 'rw',
    lazy_build => 1
);

sub _build_tree {
    my ($self) = @_;
    HTML::TreeBuilder->new_from_file( $self->file );
}

lookdown name => seeks => [ id => 'name' ] ;
  

lookdown w => seeks => [ id => qr/w.lc.me/ ] ;


1;

package main;

my $o = Get4->new;

warn $o->w->as_HTML;

1;
